

<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
    const urlParams = new URLSearchParams(window.location.search);
    const SAMLRequest = urlParams.get('SAMLRequest');
    const binding = urlParams.get('binding');
    let next = '{{next}}'+'?SAMLRequest='+SAMLRequest+'&binding='+binding;
    spauthn = localStorage.getItem("spauthn");
    console.log(spauthn);
    if( spauthn!=null && spauthn != "" ){
        localStorage.removeItem("spauthn");
        window.location.href = next+'&spauthn='+spauthn;
    }else{
        console.log("login_url")
        console.log("{{login_url}}")
        window.location.href = "{{login_url | safe}}"
    }
</script>